package net.jlibrary.group.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.BatchSize;

import net.jlibrary.common.core.annotation.CodeGenComment;
import net.jlibrary.common.core.annotation.SearchCondition;
import net.jlibrary.common.core.annotation.SearchField;
import net.jlibrary.common.core.annotation.SeePurview;
import net.jlibrary.common.core.entity.BaseObject;
/**
 * 停车区对接信息
 * @author fzys
 *
 */
@Entity(name = "tab_parkingplacesystemdocking")
@SeePurview(value = "parkingPlace.globalPath")
@BatchSize(size = 15)
@CodeGenComment(value = "停车区对接信息", genSelect = false)
public class ParkingPlaceSystemDocking extends BaseObject {
	private static final long serialVersionUID = -6306870932133193385L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@SearchField(value = "id", condition = SearchCondition.EQUAL)
	private Long id;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parkingPlace_id")
	@CodeGenComment(value = "停车区", viewList = true, required = true)
	private ParkingPlace parkingPlace;//停车区
	@Column(length = 50,unique = true)
	@CodeGenComment(value = "停车区对接编码", viewList = true, required = true)
	private String code;//停车区对接编码
	@Column(length = 50)
	@CodeGenComment(value = "密钥", viewList = true, required = true)
	private String skey;//密钥
	@Column(length = 50)
	@CodeGenComment(value = "appId", viewList = true, required = true)
	private String appId;
	@Column(length = 50)
	@CodeGenComment(value = "调用接口地址", viewList = true)
	private String curbUrl;//调用接口地址
	
	@Column(updatable = false)
	@Temporal(TemporalType.TIMESTAMP)
	@CodeGenComment(value = "创建时间", viewList = true)
	private Date createdate;
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastdate;
	public Long getId() {
		return id;
	}
	@Override
	public Serializable getPrimaryKey() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public ParkingPlace getParkingPlace() {
		return parkingPlace;
	}
	public void setParkingPlace(ParkingPlace parkingPlace) {
		this.parkingPlace = parkingPlace;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	
	public String getAppId() {
		return appId;
	}
	public void setAppId(String appId) {
		this.appId = appId;
	}
	public String getCurbUrl() {
		return curbUrl;
	}
	public void setCurbUrl(String curbUrl) {
		this.curbUrl = curbUrl;
	}
	public Date getCreatedate() {
		return createdate;
	}
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}
	public Date getLastdate() {
		return lastdate;
	}
	public void setLastdate(Date lastdate) {
		this.lastdate = lastdate;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ParkingPlaceSystemDocking other = (ParkingPlaceSystemDocking) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	public String getSkey() {
		return skey;
	}
	public void setSkey(String skey) {
		this.skey = skey;
	}
}
